function res()
{ myform.reset();
  document.all.check.value="";
  
}
function n2(num)
{
if(num==1)
{
b06.style.background=c;
b18.style.background=c;
b30.style.background=c;
b42.style.background=c;
}else
{
b06.style.background=b;
b18.style.background=b;
b30.style.background=b;
b42.style.background=b;	
}
}
function h3(num)
{
if(num==1)
{
b05.style.background=c;
b17.style.background=c;
b29.style.background=c;
b41.style.background=c;
}else
{
b05.style.background=b;
b17.style.background=b;
b29.style.background=b;
b41.style.background=b;
}
}
function t4(num)
{
if(num==1)
{
 b04.style.background=c;
b16.style.background=c;
b28.style.background=c;
b40.style.background=c;
}else
{
b04.style.background=b;
b16.style.background=b;
b28.style.background=b;
b40.style.background=b;
}
}
function l5(num)
{
if(num==1)
{
b03.style.background=c;
b15.style.background=c;
b27.style.background=c;
b39.style.background=c;
}else
{
 b03.style.background=b;
b15.style.background=b;
b27.style.background=b;
b39.style.background=b;
}
}
function c6(num)
{
if(num==1)
{
b02.style.background=c;
b14.style.background=c;
b26.style.background=c;
b38.style.background=c;
}else
{
b02.style.background=b;
b14.style.background=b;
b26.style.background=b;
b38.style.background=b;
}
}
function m7(num)
{
if(num==1)
{
b01.style.background=c;
b13.style.background=c;
b25.style.background=c;
b37.style.background=c;
b49.style.background=c;
}else
{
b01.style.background=b;
b13.style.background=b;
b25.style.background=b;
b37.style.background=b;
b49.style.background=b;
}
}
function y8(num)
{
if(num==1)
{
b12.style.background=c;
b24.style.background=c;
b36.style.background=c;
b48.style.background=c;
}else
{
b12.style.background=b;
b24.style.background=b;
b36.style.background=b;
b48.style.background=b;
}
}
function h9(num)
{
if(num==1)
{
b11.style.background=c;
b23.style.background=c;
b35.style.background=c;
b47.style.background=c;
}else
{
b11.style.background=b;
b23.style.background=b;
b35.style.background=b;
b47.style.background=b;	
}
}
function j10(num)
{
if(num==1)
{
b10.style.background=c;
b22.style.background=c;
b34.style.background=c;
b46.style.background=c;
}else
{
b10.style.background=b;
b22.style.background=b;
b34.style.background=b;
b46.style.background=b;
}
}
function g11(num)
{
if(num==1)
{
b09.style.background=c;
b21.style.background=c;
b33.style.background=c;
b45.style.background=c;
}else
{
b09.style.background=b;
b21.style.background=b;
b33.style.background=b;
b45.style.background=b;
}
}
function z12(num)
{
if(num==1)
{
b08.style.background=c;
b20.style.background=c;
b32.style.background=c;
b44.style.background=c;
}else
{
b08.style.background=b;
b20.style.background=b;
b32.style.background=b;
b44.style.background=b;
}
}
function s1(num)
{
if(num==1)
{
b07.style.background=c;
b19.style.background=c;
b31.style.background=c;
b43.style.background=c;
}else
{
b07.style.background=b;
b19.style.background=b;
b31.style.background=b;
b43.style.background=b;
}
}
function suma()
{ 
  
nums=myform.s1.value+myform.n2.value+myform.h3.value+myform.t4.value+myform.l5.value+myform.c6.value+myform.m7.value+myform.y8.value+myform.h9.value+myform.j10.value+myform.g11.value+myform.z12.value;
myform.check.value=nums;
}
function sanimal(arr,menu,num)
{
 if(arr==c)
 {
 menu.style.background=b;
 if(num==1)
 { 
  myform.s1.value="";
  s1(2);
  suma();
 }
 if(num==2)
 {
  myform.n2.value="";
  n2(2);
  suma();
 }
 if(num==3)
 { 
  h3(2);
  myform.h3.value="";
  suma();
 }
 if(num==4)
 { 
  t4(2);
  myform.t4.value="";
  suma();
 }
  if(num==5)
 { 
  l5(2);
  myform.l5.value="";
  suma();
 }
  if(num==6)
 { 
  c6(2);
  myform.c6.value="";
  suma();
 }
  if(num==7)
 { 
  m7(2);
  myform.m7.value="";
  suma();
 }
  if(num==8)
 { 
  y8(2);
  myform.y8.value="";
  suma();
 }
  if(num==9)
 { 
  h9(2);
  myform.h9.value="";
  suma();
 }
  if(num==10)
 { 
  j10(2);
  myform.j10.value="";
  suma();
 }
  if(num==11)
 { 
  g11(2);
  myform.g11.value="";
  suma();
 }
  if(num==12)
 { 
  z12(2);
  myform.z12.value="";
  suma();
 }
}else
 {
   menu.style.background=c;
   if(num==1)
   { 
    myform.s1.value="07,19,31,43,";
    s1(1);
	suma();
   }
   if(num==2)
   {
	myform.n2.value="06,18,30,42,";
	n2(1);
	suma();
   }
   if(num==3)
   {
	myform.h3.value="05,17,29,41,";
	h3(1);
	suma();
   }
   if(num==4)
   {
	myform.t4.value="04,16,28,40,";
	t4(1);
	suma();
   }
   if(num==5)
   {
	myform.l5.value="03,15,27,39,";
	l5(1);
	suma();
   }
   if(num==6)
   {
	myform.c6.value="02,14,26,38,";
	c6(1);
	suma();
   }
   if(num==7)
   {
	myform.m7.value="01,13,25,37,49,";
	m7(1);
	suma();
   }
   if(num==8)
   {
	myform.y8.value="12,24,36,48,";
	y8(1);
	suma();
   }
    if(num==9)
   {
	myform.h9.value="11,23,35,47,";
	h9(1);
	suma();
   }
    if(num==10)
   {
	myform.j10.value="10,22,34,46,";
	j10(1);
	suma();
   }
    if(num==11)
   {
	myform.g11.value="09,21,33,45,";
	g11(1);
	suma();
   }
    if(num==12)
   {
	myform.z12.value="08,20,32,44,";
	z12(1);
	suma();
   }
 }
}
//头
function settou(arr,menu,num)
{
 if(arr==c)
 {
 menu.style.background=b;
  if(num==0)
 { 
  myform.check.value="";
  tou0(2);
 }
 if(num==1)
 { 
  myform.check.value="";
  tou1(2);
 }
 if(num==2)
 {
  myform.check.value="";
  tou2(2);
 }
 if(num==3)
 { 
  tou(2);
  myform.check.value="";
 }
 if(num==4)
 { 
  tou4(2);
  myform.check.value="";
 }
}else
 {

 menu.style.background=c;
	if(num==0)
   { 
    myform.check.value="01,02,03,04,05,06,07,08,09,";
    tou0(1);
   }
   if(num==1)
   { 
    myform.check.value="10,11,12,13,14,15,16,17,18,19,";
    tou1(1);
   }
   if(num==2)
   {
	 myform.check.value="20,21,22,23,24,25,26,27,28,29,";
	tou2(1);
   }
   if(num==3)
   {
	 myform.check.value="30,31,32,33,34,35,36,37,38,39,";
	tou3(1);
   }
   if(num==4)
   {
	myform.check.value="40,41,42,43,44,45,46,47,48,49,";
	
	tou4(1);
	
   }
 }
}
function tou0(num)
{
if(num==1)
{
b01.style.background=c;
b02.style.background=c;
b03.style.background=c;
b04.style.background=c;
b05.style.background=c;
b06.style.background=c;
b07.style.background=c;
b08.style.background=c;
b09.style.background=c;
}else
{
b01.style.background=b;
b02.style.background=b;
b03.style.background=b;
b04.style.background=b;
b05.style.background=b;
b06.style.background=b;
b07.style.background=b;
b08.style.background=b;
b09.style.background=b;
}
}
function tou1(num)
{
if(num==1)
{
b10.style.background=c;
b11.style.background=c;
b12.style.background=c;
b13.style.background=c;
b14.style.background=c;
b15.style.background=c;
b16.style.background=c;
b17.style.background=c;
b18.style.background=c;
b19.style.background=c;
}else
{
b10.style.background=b;
b11.style.background=b;
b12.style.background=b;
b13.style.background=b;
b14.style.background=b;
b15.style.background=b;
b16.style.background=b;
b17.style.background=b;
b18.style.background=b;
b19.style.background=b;
}
}
function tou2(num)
{
if(num==1)
{
b20.style.background=c;
b21.style.background=c;
b22.style.background=c;
b23.style.background=c;
b24.style.background=c;
b25.style.background=c;
b26.style.background=c;
b27.style.background=c;
b28.style.background=c;
b29.style.background=c;
}else
{
b20.style.background=b;
b21.style.background=b;
b22.style.background=b;
b23.style.background=b;
b24.style.background=b;
b25.style.background=b;
b26.style.background=b;
b27.style.background=b;
b28.style.background=b;
b29.style.background=b;
}
}
function tou3(num)
{
if(num==1)
{
b30.style.background=c;
b31.style.background=c;
b32.style.background=c;
b33.style.background=c;
b34.style.background=c;
b35.style.background=c;
b36.style.background=c;
b37.style.background=c;
b38.style.background=c;
b39.style.background=c;
}else
{
b30.style.background=b;
b31.style.background=b;
b32.style.background=b;
b33.style.background=b;
b34.style.background=b;
b35.style.background=b;
b36.style.background=b;
b37.style.background=b;
b38.style.background=b;
b39.style.background=b;
}
}
function tou4(num)
{
if(num==1)
{
b40.style.background=c;
b41.style.background=c;
b42.style.background=c;
b43.style.background=c;
b44.style.background=c;
b45.style.background=c;
b46.style.background=c;
b47.style.background=c;
b48.style.background=c;
b49.style.background=c;
}else
{
b40.style.background=b;
b41.style.background=b;
b42.style.background=b;
b43.style.background=b;
b44.style.background=b;
b45.style.background=b;
b46.style.background=b;
b47.style.background=b;
b48.style.background=b;
b49.style.background=b;
}
}
function wei0(num)
{
if(num==1)
{
b10.style.background=c;
b20.style.background=c;
b30.style.background=c;
b40.style.background=c;
}else
{
b10.style.background=b;
b20.style.background=b;
b30.style.background=b;
b40.style.background=b;
}
}
function wei1(num)
{
if(num==1)
{
b01.style.background=c;
b11.style.background=c;
b21.style.background=c;
b31.style.background=c;
b41.style.background=c;
}else
{
b01.style.background=b;
b11.style.background=b;
b21.style.background=b;
b31.style.background=b;
b41.style.background=b;
}
}
function wei2(num)
{
if(num==1)
{
b02.style.background=c;
b12.style.background=c;
b22.style.background=c;
b32.style.background=c;
b42.style.background=c;
}else
{
b02.style.background=b;
b12.style.background=b;
b22.style.background=b;
b32.style.background=b;
b42.style.background=b;
}
}
function wei3(num)
{
if(num==1)
{
b03.style.background=c;
b13.style.background=c;
b23.style.background=c;
b33.style.background=c;
b43.style.background=c;
}else
{
b03.style.background=b;
b13.style.background=b;
b23.style.background=b;
b33.style.background=b;
b43.style.background=b;
}
}
function wei4(num)
{
if(num==1)
{
b04.style.background=c;
b14.style.background=c;
b24.style.background=c;
b34.style.background=c;
b44.style.background=c;
}else
{
b04.style.background=b;
b14.style.background=b;
b24.style.background=b;
b34.style.background=b;
b44.style.background=b;
}
}
function wei5(num)
{
if(num==1)
{
b05.style.background=c;
b15.style.background=c;
b25.style.background=c;
b35.style.background=c;
b45.style.background=c;
}else
{
b05.style.background=b;
b15.style.background=b;
b25.style.background=b;
b35.style.background=b;
b45.style.background=b;
}
}
function wei6(num)
{
if(num==1)
{
b06.style.background=c;
b16.style.background=c;
b26.style.background=c;
b36.style.background=c;
b46.style.background=c;
}else
{
b06.style.background=b;
b16.style.background=b;
b26.style.background=b;
b36.style.background=b;
b46.style.background=b;
}
}
function wei7(num)
{
if(num==1)
{
b07.style.background=c;
b17.style.background=c;
b27.style.background=c;
b37.style.background=c;
b47.style.background=c;
}else
{
b07.style.background=b;
b17.style.background=b;
b27.style.background=b;
b37.style.background=b;
b47.style.background=b;
}
}
function wei8(num)
{
if(num==1)
{
b08.style.background=c;
b18.style.background=c;
b28.style.background=c;
b38.style.background=c;
b48.style.background=c;
}else
{
b08.style.background=b;
b18.style.background=b;
b28.style.background=b;
b38.style.background=b;
b48.style.background=b;
}
}
function wei9(num)
{
if(num==1)
{
b09.style.background=c;
b19.style.background=c;
b29.style.background=c;
b39.style.background=c;
b49.style.background=c;
}else
{
b09.style.background=b;
b19.style.background=b;
b29.style.background=b;
b39.style.background=b;
b49.style.background=b;
}
}
//头
function setwei(arr,menu,num)
{
 if(arr==c)
 {
 
 menu.style.background=b;
 if(num==0)
 { 
  myform.check.value="";
  wei0(2);
 }
 if(num==1)
 { 
  myform.check.value="";
  wei1(2);
 }
 if(num==2)
 {
  myform.check.value="";
  wei2(2);
 }
 if(num==3)
 { 
  wei3(2);
  myform.check.value="";
 }
 if(num==4)
 { 
  wei4(2);
  myform.check.value="";
 }
 if(num==5)
 { 
  wei5(2);
  myform.check.value="";
 }
 if(num==6)
 { 
  wei6(2);
  myform.check.value="";
 }
 if(num==7)
 { 
  wei7(2);
  myform.check.value="";
 }
 if(num==8)
 { 
  wei8(2);
  myform.check.value="";
 }
 if(num==9)
 { 
  wei9(2);
  myform.check.value="";
 }
}else
 {

 menu.style.background=c;
	if(num==0)
   { 
    myform.check.value="10,20,30,40,";
    wei0(1);
   }
   if(num==1)
   { 
    myform.check.value="01,11,21,31,41,";
    wei1(1);
   }
   if(num==2)
   {
	 myform.check.value="02,12,22,32,42,";
	wei2(1);
   }
   if(num==3)
   {
	 myform.check.value="03,13,23,33,43,";
	wei3(1);
   }
   if(num==4)
   {
	myform.check.value="04,14,24,34,44,";
	wei4(1);
   }
   if(num==5)
   {
	myform.check.value="05,15,25,35,45,";
	wei5(1);
   }
   if(num==6)
   {
	myform.check.value="06,16,26,36,46,";
	wei6(1);
   }
   if(num==7)
   {
	myform.check.value="07,17,27,37,47,";
	wei7(1);
   }
   if(num==8)
   {
	myform.check.value="08,18,28,38,48,";
	wei8(1);
   }
   if(num==9)
   {
	myform.check.value="09,19,29,39,49,";
	wei9(1);
   }
 }
}
function allps()
{
var ss=b;
b01.style.background=ss;
b02.style.background=ss;
b03.style.background=ss;
b04.style.background=ss;
b05.style.background=ss;
b06.style.background=ss;
b07.style.background=ss;
b08.style.background=ss;
b09.style.background=ss;
b10.style.background=ss;
b11.style.background=ss;
b12.style.background=ss;
b13.style.background=ss;
b14.style.background=ss;
b15.style.background=ss;
b16.style.background=ss;
b17.style.background=ss;
b18.style.background=ss;
b19.style.background=ss;
b20.style.background=ss;
b21.style.background=ss;
b22.style.background=ss;
b23.style.background=ss;
b24.style.background=ss;
b25.style.background=ss;
b26.style.background=ss;
b27.style.background=ss;
b28.style.background=ss;
b29.style.background=ss;
b30.style.background=ss;
b31.style.background=ss;
b32.style.background=ss;
b33.style.background=ss;
b34.style.background=ss;
b35.style.background=ss;
b36.style.background=ss;
b37.style.background=ss;
b38.style.background=ss;
b39.style.background=ss;
b40.style.background=ss;
b41.style.background=ss;
b42.style.background=ss;
b43.style.background=ss;
b44.style.background=ss;
b45.style.background=ss;
b46.style.background=ss;
b47.style.background=ss;
b48.style.background=ss;
b49.style.background=ss;
}